[mirrors]
https://www.kernel.org/pub/linux/utils/util-linux/v2.28/util-linux-2.28.tar.xz

[vars]
filesize=4119560
sha512=a1f911bdfda5985de87105d39501e501a5f9ec0fe6a433e3f2fed9a80e104342bb4a7e0e6dc9b7d677d5429249f05b343cb5370b0ea0e068dc889699d4ec1f8a
desc="System utilities for Linux, cut-down for Quirky Linux"

[deps]
curses
zlib

[build]
#this installs a cutdown set of utilities, in some cases replacing busybox applets.
#this is done from years of experience with puppy linux, where the busybox applets
#were found to be inadequate.
#this also installs libblkid and libuuid. those in e2fsprogs are disabled.
#20160516: --disable-all-programs, followed by --enable-<name> is supposed to work, but doesn't,
# so have to compile everything, then install, then delete what i don't want.

patch -p1 < "$K"/util-linux-fix-nls-disabled.patch

#20160516 'more', 'pg' do not compile...
CFLAGS="-D_GNU_SOURCE $optcflags" \
LDFLAGS="$optldflags -lcurses -lterminfo" \
./configure -C \
  --prefix="$butch_prefix" --with-ncurses --enable-shared --disable-static  \
  --disable-silent-rules --disable-nls --disable-colors-default --without-udev \
  --disable-use-tty-group --without-python --without-readline \
  --enable-libmount --enable-libuuid --enable-libblkid --enable-libsmartcols \
  --enable-libfdisk --disable-more --disable-pg

make -j$MAKE_THREADS

make DESTDIR="$butch_install_dir" install

#20160516 now keep want i want...
WHATIWANT=' addpart cfdisk col delpart eject fdformat fdisk flock fsck getopt hwclock ldattach losetup mkfs mkswap mount partx readprofile rename resizepart rev rtcwake setarch setsid swapoff swapon umount uuidd whereis '
dest="$butch_install_dir""$butch_prefix"
ALLINSTALLED="$(find "$dest"/bin "$dest"/sbin -maxdepth 1 -type f | tr '\n' ' ')"
for AINSTALLED in $ALLINSTALLED
do
 [ ! -f $AINSTALLED ] && continue
 ANAME="$(basename $AINSTALLED)"
 [ "$(echo -n "$WHATIWANT" | grep " ${ANAME} ")" != "" ] && continue
 rm -f $AINSTALLED
done

#puppy-heritage thing...
mv -f ${dest}/bin/mount ${dest}/bin/mount-FULL
mv -f ${dest}/bin/umount ${dest}/bin/umount-FULL
mv -f ${dest}/sbin/losetup ${dest}/sbin/losetup-FULL

